import axios from 'axios';
import { req,reqJson } from './axiosFun';
/**
 * 支付配置信息
 **/
// 支付配置信息-获取支付配置信息列表
export const MachineConfigList = (params) => { return req("post", "/api/MachineConfig/list", params) };
// 支付配置信息-保存支付配置信息
export const MachineConfigSave = (params) => { return req("post", "/api/MachineConfig/save", params) };
// 支付配置信息-删除支付配置信息
// export const MachineConfigDelete = (params) => { return axios.delete("/api/MachineConfig/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
export const MachineConfigDelete = (params) => { return req("delete","/api/MachineConfig/delete/" + params).then(res => res.data) };
//获取支付方式信息
export const ModeList = (parms) => { return req("get", "/api/MachineConfig/mode",parms) };

/**
 * 支付配置
 **/
// 支付配置-获取支付配置列表
export const ConfigList = (params) => { return req("post", "/api/Config/list", params) };
// 支付配置-保存支付配置
export const ConfigSave = (params) => { return req("post", "/api/Config/save", params) };
// 支付配置-删除支付配置
// export const ConfigDelete = (params) => { return axios.delete("/api/Config/delete/ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
export const ConfigDelete = (params) => { return req("delete","/api/Config/delete/" + params ).then(res => res.data) };

/**
 * 订单管理-交易订单
 **/
// 交易订单-获取交易订单列表
export const OrderList = (params) => { return req("post", "/api/Order/list", params) };
// 交易订单-删除交易订单
// export const OrderDelete = (params) => { return axios.delete("/api/Order/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
export const OrderDelete = (params) => { return req("delete","/api/Order/delete/" + params).then(res => res.data) };
// 支付配置-保存交易订单
export const OrderSave = (params) => { return req("post", "/api/Order/save", params) };
// 交易订单-交易订单退款
export const OrderRefund = (params) => { return req("post", "/api/Order/refund", params) };
//获取订单状态
export const OrderStat = () => { return req("get", "/api/Order/stat") };
//通过部门编号获得部门名称
export const OrderDeptName = (params) => { return req("get", "/api/Order/dept"+ params)};
//通过商品编号获取支付金额、商品价格和商品名称
export const OrderGoods = (params) => { return req("get", "/api/Order/goods",params) };
//通过终端编号获取支付方式、子支付方式
export const OrderCnfinfo = (params) => { return req("get", "/api/Order/cnfinfo"+ params) };
//通过商户号获取子商户号、商户卖家、加密类型、商户签名秘钥
export const OrderCnf = (params) => { return req("get", "/api/Order/cnf"+ params)};


/**
 * 图表数据可视化
 */
//图表数据可视化-获取突变数据可视化
export const Statistics = (params) => { return req("post", "/api/Statistics/list",params)};

//图表数据可视化-获取所有部门信息
export const StatisticsDept = () => { return req("get", "/api/Statistics/dept")};

//图表数据可视化-获取交易总金额
export const DealAmount = (params) => { return req("get", "/api/Order/cnf"+ params)};

//图表数据可视化-获取交易总点击量
export const DealClick = (params) => { return req("get", "/api/Order/cnf"+ params)};

//图表数据可视化-获取支付方式统计（笔数）
export const ModeNum = (params) => { return req("get", "/api/Order/cnf"+ params)};

//图表数据可视化-获取支付方式统计（金额）
export const ModeAmount = (params) => { return req("get", "/api/Order/cnf"+ params)};



/**
 *基础管理-库存管理
 */
//库存管理-获取所有库存信息
export const getInventory = (params) => { return req("post", "/api/Repertory/list",params)};

//库存管理-添加库存信息
export const saveInvatory= (params) => { return req("post", "/api/Repertory/save",params)};

//库存管理-删除
export const removeInventory = (params) => { return req("delete", "/api/Repertory/delete/"+params)};

//库存管理-获取部门信息
export const inventoryDept = () => { return req("get", "/api/Repertory/dept")};

//库存管理-入库
export const inInventory = (params) => { return req("post", "/api/Repertory/in",params)};

//库存管理-出库
export const outInventory = (params) => { return req("post", "/api/Repertory/out",params)};

//库存管理-出库
export const showScanData = (params) => { return req("post", "/api/Repertory/show",params)};

//库存管理-上传数据（excel）
export const up = (params) => { return req("post", "/api/Repertory/up",params)};

// //库存管理-下载数据到excel
// export const down = (params) => { return req("post", "/api/Repertory/down",params)};
